<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "dd_ai_applications".
 *
 * @property int $id
 * @property string|null $name 人脸库应用名称
 * @property string|null $appid appid
 * @property string|null $create_time
 * @property string|null $updatetime
 */
class DdAiApplications extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'dd_ai_applications';
    }

     /**
     * 行为
     */
    public function behaviors()
    {
        /*自动添加创建和修改时间*/
        return [
           [
               'class'=>\common\behaviors\SaveBehavior::className(),
               'updatedAttribute'=>'create_time',
               'createdAttribute'=>'updatetime',
           ]
        ];
    }


    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['id'], 'integer'],
            [['create_time', 'updatetime'], 'safe'],
            [['name', 'APP_ID','API_KEY','SECRET_KEY'], 'string', 'max' => 50],
            [['id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '应用名称',
            'APP_ID' => 'APP_ID',
            'API_KEY' => 'API_KEY',
            'SECRET_KEY' => 'SECRET_KEY',
            'create_time' => '创建时间',
            'updatetime' => '更新时间',
        ];
    }
}
